using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using Entities;
using DAL;
using BUS;
using Utility;


public partial class KhachHang_Muagiohang : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            LoadData();
        }

    }

    private void LoadData()
    {
        ShoppingCart c = (ShoppingCart)Session["Cart"];
        rp_gio_hang.DataSource = c.ItemCollection;
        rp_gio_hang.DataBind();
        lit_tong_tien.Text = c.Total().ToString();
        if (Session["kh"] == null)
        {
            //a_order.Visible = false;
        }
    }

    protected void rp_gio_hang_ItemDataBound(object sender, RepeaterItemEventArgs e)
    {
        if (e.Item.ItemType == ListItemType.AlternatingItem ||
           e.Item.ItemType == ListItemType.Item)
        {
            Item i = (Item)e.Item.DataItem;
            Literal lit_tt = (Literal)e.Item.FindControl("lit_tt");
            int thanhtien = (i.GiaBan  * i.SoLuong);
            lit_tt.Text = thanhtien.ToString();
        }
    }


}
